<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>短信设置 - Powered By Betou</title>
<meta name="author" content="Betou Team" />
<meta name="copyright" content="Betou" />
<#include "../head.html"/>
<script type="text/javascript">
$().ready(function() {
	var $inputForm = $("#inputForm");
	$inputForm.validate({
		rules: {
			smsNum:{
				required: true,
				digits:true
				<#if !admin.system>,
				max:${admin.smsNum!0}
				</#if>
			}
		}
	});
	<#if admin.system>
	loadSmsNum();
	</#if>
});
<#if admin.system>
loadSmsNum = function(){
	$.ajax({
		url: "../v_sms_surplus.jspx" ,
		type: "GET",
		cache: false,
		success: function(message) {
			if (message.type == "success") {
				$('#num').html( message.content );
			}
		},
		error:function(xmlHttpRequest, message, e){
			$.message( "error", e );
		}
	});
}
</#if>
</script>

</head>
<body class="content">
	<div class="path">
		<a href="../index.jspx">首页</a> &raquo; 短信设置&raquo; ${bean.intermediaName!}
	</div>
	<form id="inputForm" action="o_update.jspx" method="post">
		<input type="hidden" name="beanId" value="${bean.id}"/>
		<table class="input">
			<#if admin.system>
			<tr>
				<th>本站点剩余短信数量(该数据仅供参考)：</th>
				<td><span id="num"  class="red">0</span>条 <a href="javascript:;" onclick="loadSmsNum();">[重新加载]</a></td>
			</tr>
			<#else>
				<tr>
					<th>我的短信数量：</th>
					<td><span id="num"  class="red">${admin.smsNum!0}</span>条 </td>
				</tr>
			</#if>
			<tr>
				<th>【${bean.intermediaName!}】的短信数量：</th>
				<td><span id="s"  class="green">${smsNum!}</span>条 </td>
			</tr>
			<tr>
				<th><span class="requiredField">*</span>赠送短信数量</th>
				<td>
					<input name="smsNum"  type="text"  class="text"  title="请填写短信数量"  maxlength="10" />
				</td>
			</tr>
			<tr>
				<th>&nbsp;</th>
				<td>
					<input type="submit" class="button" value="确&nbsp;&nbsp;定" />
				</td>
			</tr>
		</table>
	</form>
	<#include "../footer.html"/>
</body>
</html>